﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Secams.controller
{
    class SignOnManager
    {
        public const string ROLE_ADMIN = "admin";
        public const string ROLE_PARTICIPANT = "participant";

        protected static SignOnManager _instance = new SignOnManager();

        public static SignOnManager getInstance()
        {
            return _instance;
        }

        /// <summary>
        /// Attempts sign in
        /// </summary>
        /// <param name="id"></param>
        /// <param name="password"></param>
        /// <returns>the role of the user signed in, null if failed</returns>
        public string signIn(string id, string password)
        {
            if (id.Equals("admin") && password.Equals("ddmadmin"))
                return ROLE_ADMIN;
            return ROLE_PARTICIPANT;
        }
    }
}
